<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .table{
            height:200px;
            width: 700px;
            margin: 100px auto;
            padding-top: 10px;
            border-radius: 20px;
            text-align: center;
            background-color: blanchedalmond;
        }
        .tab_list{
            height: 30px;
        }
        .current{
            border-bottom: 2px solid red;
        }
        .tab_list li{
           
            display: inline-block;
            padding: 10px;
            list-style: none;
        }
        .tab_con{
            margin-top: 30px;
           
        }
        .item{
            display: none;
        }
        .now{
            display: block;
        }
    </style>
</head>
<body>
    <form action="/Goods/delete" method="POST">
        <input type="hidden" name="submitFlag" value="delete">
        <div class="table">
        <h2>删除商品</h2>
        <div class="tab_list">
            <ul>
                <li class="current">商品条码删除</li>
                <li>商品名称删除</li>     
            </ul>
        </div>
        <div class="tab_con">
            <div class="item now" >
                <label for="id">条码</label><input type="text" id="id" name="id">
                <input type="submit" value="查询">
            </div>
            <div class="item">
                <label for="fullName">商品名称</label><input type="text" id="fullName" name="fullName">
                <input type="submit" value="查询">
            </div>
            
        </div>
    </div> 
    </form>
    <script>
        var tab_list = document.querySelector('.tab_list');
        var tab_con = document.querySelector('.tab_con');
        var lis = tab_list.querySelectorAll('li');
        var items = tab_con.querySelectorAll('.item');
        for(var i=0;i<lis.length;i++){
            lis[i].setAttribute('index',i);
            lis[i].onclick = function(){
                for(var i=0;i<lis.length;i++){
                    lis[i].className = ''
                }
                this.className = 'current';
                var index = this.getAttribute('index');
                for(var i=0;i<items.length;i++){
                    items[i].style.display = 'none';
                }
                items[index].style.display = 'block';
            }
        }

    </script>
</body>
</html>